<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./axios.min.js"></script>
    <script>

        const request = axios.create({
            baseURL: 'http://localhost:8080',
            timeout: 1000,
            headers:{
                'token':'123456789'
            }
        });


        request({
            url: '/user/list',
            method: 'get'
        }).then(response => {
            console.log("数据获取成功", response);
        }).catch(error => {
            console.log("数据获取失败", error);
        });

        request.get('/user/list')
            .then(response => {
                console.log("数据获取成功", response);
            }).catch(error => {
                console.log("数据获取失败", error);
            });
    </script>
</body>

</html>